package com.cnhis.cloudhealth.clinical.medical.base.dao;

import com.cnhis.cloudhealth.commons.dao.BaseDao;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository
public class MperformDao extends BaseDao {
    /**
     * @Description:(修改附属医嘱费用明细状态1)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public void costDetail1(Map map) throws Exception {
        update("Mperform.costDetail1",map);
    }


    /**
     * @Description:(修改附属医嘱费用明细状态1)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public void costDetail1_2(Map map) throws Exception {
        update("Mperform.costDetail1_2",map);
    }
    /**
     * @Description:(修改附属医嘱费用明细状态2)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public void costDetail2(Map map) throws Exception {
        update("Mperform.costDetail2",map);
    }

    /**
     * @Description:(医技退费审核确认)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String,Object> findRefund(Map map) throws Exception {
        List list = this.queryForList("Mperform.findRefund", map);
        Map<String, Object> rmap = new HashMap<String, Object>();
        rmap.put("list", list);
        return rmap;
    }

    /**
     * @Description:(病人退费申请)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String,Object> findAppRefund(Map map) throws Exception {
        return (Map<String, Object>)this.queryToObject("Mperform.findAppRefund", map);
    }
    /**
     * @Description:(更新退费状态1)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public void refund1(Map map) throws Exception {
        update("Mperform.refund1",map);
    }

    /**
     * @Description:(更新退费状态2)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public void refund2(Map map) throws Exception {
        update("Mperform.refund2",map);
    }

    /**
     * @Description:(判断是否会员一卡通扣费病人)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String,Object> findByVAA1(Map map) throws Exception {
        return (Map<String, Object>) this.queryToObject("Mperform.findByVAA1", map);
    }
    /**
     * @Description:(获取医嘱抄送记录)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String,Object> findByVBI1(Map map) throws Exception {
        return (Map<String, Object>) this.queryToObject("Mperform.findByVBI1", map);
    }

    /**
     * @Description:(获取医嘱抄送记录VBI1_2)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String,Object> findByVBI1_2(Map map) throws Exception {
        return (Map<String, Object>) this.queryToObject("Mperform.findByVBI1_2", map);
    }

    /**
     * @Description:(获取医嘱抄送记录VBI2)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String,Object> findByVBI2(Map map) throws Exception {
        return (Map<String, Object>) this.queryToObject("Mperform.findByVBI2", map);
    }

    /**
     * @Description:(对应医嘱是否发送findByVAF1)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String,Object> findByVAF1(Map map) throws Exception {
        return (Map<String, Object>) this.queryToObject("Mperform.findByVAF1", map);
    }

    /**
     * chengshaowei 2016/12/30 16:15
     * @Title: findVbi1ByVaf1Sid
     * @Description: （查询子医嘱信息）
     * @param map
     * @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
     * @throws
     */
    public List<Map<String, Object>> findVbi1ByVaf1Sid(Map map)throws Exception {
        return (List<Map<String, Object>>) this.queryForList("Mperform.findVbi1ByVaf1Sid", map);
    }
    /**
     * @Description:(对应医嘱是否发送findByVAF2)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String,Object> findByVAF2(Map map) throws Exception {
        return (Map<String, Object>) this.queryToObject("Mperform.findByVAF2", map);
    }

    /**
     * @Description:(查询是否收费)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public List<Map<String,Object>> findVAJ1(Map map) throws Exception {
        return (List<Map<String, Object>>) this.queryForList("Mperform.findVAJ1", map);
    }

    /**
     * @Description:(查询是否收费)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String,Object> findTmpVAIb(Map map) throws Exception {
        return (Map<String, Object>) this.queryToObject("Mperform.findTmpVAIb", map);
    }

    /**
     * @Description:(查询是否是会员)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String,Object> findMembers(Map map) throws Exception {
        return (Map<String, Object>) this.queryToObject("Mperform.findMembers", map);
    }

    /**
     * @Description:(保存医嘱执行)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public void batchinsertByVo(List<Map<String,Object>> list) throws Exception {
        insert("medical_vbj1.batchinsertByVo", list);
    }

    /**
     * @Description:(查询是否收费)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String,Object> findByDeduction(Map map) throws Exception {
        return (Map<String, Object>) this.queryToObject("Mperform.findByDeduction", map);
    }

    /**
     * @Description:(查询是否收费)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public List<Map<String,Object>> findCopyState(Map map) throws Exception {
        return (List<Map<String, Object>>) this.queryForList("Mperform.findCopyState", map);
    }

    /**
     * @Description:(修改抄嘱状态)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public void updateVbi1(Map map) throws Exception {
        update("Mperform.updateVbi1",map);
    }

    /**
     * @Description:(修改抄嘱状态)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public void updateVbi1_2(Map map) throws Exception {
        update("Mperform.updateVbi1_2",map);
    }

    /**
     * @Description:(修改抄嘱状态)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public void batchUpdateVbi1(Map map) throws Exception {
        update("Mperform.batchUpdateVbi1",map);
    }

    /**
     * @Description:(修改抄嘱状态)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public void batchUpdateVbi1_2(Map map) throws Exception {
        update("Mperform.batchUpdateVbi1_2",map);
    }

    /**
     * @Description:(修改抄嘱状态)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public void updateVbi2(Map map) throws Exception {
        update("Mperform.updateVbi2",map);
    }

    /**
     * @Description:(查询医技申请)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String,Object> findByMedicalApp(Map map) throws Exception {
        return (Map<String, Object>) this.queryToObject("Mperform.findByMedicalApp", map);
    }

    /**
     * @Description:(查询划价 剔除卫生材料)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public List<Map<String,Object>> findAccurately(Map map) throws Exception {
        return (List<Map<String, Object>>) this.queryForList("Mperform.findAccurately", map);
    }

    /**
     * @Description:(查询门诊医嘱记录(剔除西药、中成药、中草药))
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public List<Map<String,Object>> findByPretreatAdvice(Map map) throws Exception {
        return (List<Map<String, Object>>) this.queryForList("Mperform.findByPretreatAdvice", map);
    }

    /**
     * @Description:(查询计算信用额度、结账金额)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public List<Map<String,Object>> findByPretreatMoney(List<Map<String,Object>> list) throws Exception {
        return (List<Map<String, Object>>) this.queryForList("Mperform.findByPretreatMoney", list);
    }

    /**
     * @Description:(检索卡余额)
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String,Object> findByCardBalance(Map<String,Object> map) throws Exception {
        return (Map<String, Object>) this.queryToObject("Mperform.findByCardBalance", map);
    }

    /**
     * @Description:(取消呼叫)
     * @param '[map]'
     * @return void
     * @throws
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public void deleteVCZ1(Map<String,Object> map) throws Exception {
        this.delete("Mperform.deleteVCZ1",map);
    }

    /**
     * @Description:(查询退费申请是否存在)
     * @param '[map]'
     * @return void
     * @throws
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public List<Map<String, Object>> findByVBY1(Map<String, Object> map) throws Exception {
        return (List<Map<String, Object>>) this.queryForList("Mperform.findByVBY1", map);
    }

    /**
     * @Description:(给药途径退费申请)
     * @param '[map]'
     * @return void
     * @throws
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public List<Map<String,Object>> findDrugWayreFund(Map<String,Object> map) throws Exception {
        return (List<Map<String, Object>>) this.queryForList("Mperform.findDrugWayreFund", map);
    }

    /**
     * @Description:(医技费用记录申请退费)
     * @param '[map]'
     * @return void
     * @throws
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public List<Map<String,Object>> findMedicalRefund(Map<String,Object> map) throws Exception {
        return (List<Map<String, Object>>) this.queryForList("Mperform.findMedicalRefund", map);
    }

    /**
     * @Description:(查询申请退费项目是否存在)
     * @param '[map]'
     * @return void
     * @throws
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public List<Map<String,Object>> findVBY1Exists(Map<String,Object> map) throws Exception {
        return (List<Map<String, Object>>) this.queryForList("Mperform.findVBY1Exists", map);
    }

    /**
     * @Description:(tmpVBYyes)
     * @param '[map]'
     * @return void
     * @throws
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public List<Map<String,Object>> tmpVBYyes(Map<String,Object> map) throws Exception {
        return (List<Map<String, Object>>) this.queryForList("Mperform.tmpVBYyes", map);
    }

    /**
     * @Description:(tmpVBYno)
     * @param '[map]'
     * @return void
     * @throws
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public List<Map<String,Object>> tmpVBYno(Map<String,Object> map) throws Exception {
        return (List<Map<String, Object>>) this.queryForList("Mperform.tmpVBYno", map);
    }

    /**
     * @Description:(tmpVBYno)
     * @param '[map]'
     * @return void
     * @throws
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public Map<String,Object> findVajByVaf01(List<Map<String,Object>> list) throws Exception {
        return (Map<String, Object>) getSqlSession().selectOne("Mperform.findVajByVaf01", list);
    }

    /**
     * @Description:(findvvajfull)
     * @param '[map]'
     * @return void
     * @throws
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public Map<String,Object> findvvajfull(Map<String,Object> map) throws Exception {
        return (Map<String, Object>) getSqlSession().selectOne("Mperform.findvvajfull", map);
    }

    /**
     * @Description:(批量保存vby1)
     * @param '[map]'
     * @return void
     * @throws
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public void batchinsertByVby1(List<Map<String,Object>> list) throws Exception {
        insert("medical_vby1.batchinsertByVby1", list);
    }
    /**
     * @Description:(批量修改vby1)
     * @param '[map]'
     * @return void
     * @throws
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public void batchupdateByVby1(List<Map<String,Object>> list) throws Exception {
        update("medical_vby1.batchupdateByVby1", list);
    }


    /**
     * @param '[map]'
     * @return void
     * @throws
     * @Description:(批量插入Veg1)
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public void batchinsertByVeg1(List<Map<String, Object>> list) throws Exception {
        insert("medical_veg1.batchinsertByVo", list);
    }

    /**
     * @param '[map]'
     * @return void
     * @throws
     * @Description:(批量修改Veg1)
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public void batchupdateByVoVeg1(List<Map<String, Object>> list) throws Exception {
        update("medical_veg1.batchupdateByVoNotNull", list);
    }

    /**
     * @param '[map]'
     * @return void
     * @throws
     * @Description:(查询是veg1否存在)
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public Map<String, Object> findVeg01(Map<String, Object> map) throws Exception {
        return (Map<String, Object>) getSqlSession().selectOne("medical_veg1.findVeg01", map);
    }


    /**
     * @param '[map]'
     * @return void
     * @throws
     * @Description:(批量插入Veg2)
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public void batchinsertByVeg2(List<Map<String, Object>> list) throws Exception {
        insert("medical_veg2.batchinsertByVo", list);
    }

    /**
     * @param '[map]'
     * @return void
     * @throws
     * @Description:(批量修改Veg2)
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public void batchupdateByVoVeg2(List<Map<String, Object>> list) throws Exception {
        update("medical_veg2.batchupdateByVoNotNull", list);
    }

    /**
     * @param '[map]'
     * @return void
     * @throws
     * @Description:(查询是veg2否存在)
     * @author chengshaowei
     * @date 2016/10/27 9:49
     */
    public Map<String, Object> findVeg2(Map<String, Object> map) throws Exception {
        return (Map<String, Object>) getSqlSession().selectOne("medical_veg2.findVeg01", map);
    }

}
